import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/backstage',
    name: '后台管理系统',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('@/views/Index.vue'),
    children:[
      {
        path: '',//默认子组件首页
        name:'后台主界面',
        component: () => import("@/views/Main")
      },
      {
        path: 'AdminManage',
        name:'账户管理',
        component: () => import("@/views/adminmanage/AdminManage")
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
